﻿<Button IsDisabled="true" Color="Color.Primary">主要按钮</Button>
<Button IsDisabled="true" Color="Color.Secondary">次要按钮</Button>
<Button IsDisabled="true" Color="Color.Success">成功按钮</Button>
<Button IsDisabled="true" Color="Color.Danger">危险按钮</Button>
<Button IsDisabled="true" Color="Color.Warning">警告按钮</Button>
<Button IsDisabled="true" Color="Color.Info">信息按钮</Button>
<Button IsDisabled="true" Color="Color.Dark">黑暗按钮</Button>
<Button IsDisabled="true" Color="Color.Light">高亮按钮</Button>
<Button IsDisabled="true" Color="Color.Link">链接按钮</Button>

<Button Text="点击被禁用" OnClick="@ClickButton1" @ref="ButtonDisableDemo" IsDisabled="@IsDisable">
    <Tooltip Title="点击按钮后由于被禁用 Tooltip 被销毁" Placement="Placement.Top" Trigger="hover" />
</Button>
<Button Color="Color.Info" Text="点击后使第一个按钮可用" OnClickWithoutRender="@ClickButton2" class="ml-3"></Button>

@code {
    private Button ButtonDisableDemo { get; set; }

    private bool IsDisable { get; set; }

    private void ClickButton1()
    {
        IsDisable = !IsDisable;
        StateHasChanged();
    }

    private Task ClickButton2()
    {
        IsDisable = false;
        ButtonDisableDemo.SetDisable(false);
        return Task.CompletedTask;
    }
}